package com.thon.service.system.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thon.dao.system.EventDao;
import com.thon.entity.system.Event;
import com.thon.service.system.EventService;
/**
*@author 张先吉
*@email 
*@date 2013年11月15日
*@descripts
*/
@Service
@Transactional
public class EventServiceImpl implements EventService {
	public static final String HASH_ALGORITHM = "SHA-1";
	public static final int HASH_INTERATIONS = 1024;
	private static final int SALT_SIZE = 8;
	
	@Autowired
	private EventDao eventDao;
	
	@Override
	public void addEvent(Event event) {
		eventDao.save(event);
	}

	@Override
	public void deleteEvent(int id) {
		eventDao.delete(id);
	}

	@Override
	public void updateEvent(Event event) {
		eventDao.update(event);
	}

	@Override
	public Event getEvent(int id) {
		return eventDao.get(id);
	}

	@Override
	public Event getEventByName(String name) {
		return eventDao.findEventByName(name);
	}

	@Override
	public List<Event> listAllEvent() {
		return eventDao.listAllEvent();
	}

}
